<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>API: treeview   TVAnim.js  (YUI Library)</title>
	<link rel="stylesheet" type="text/css" href="assets/api.css">
</head>

<body id="yahoo-com">
<div id="doc3" class="yui-t2">

	<div id="hd">
        <h1>Yahoo! UI Library</h1>
        <h3>TreeView Widget&nbsp; <span class="subtitle">2.2.2</span></h3>
        <p>
        <a href="./index.html">Yahoo! UI Library</a> 
            &gt; <a href="./module_treeview.html">treeview</a>
                
                 &gt; TVAnim.js (source view) 
            </p>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">

                    <div id="srcout">
<div class="highlight" ><pre><span class="c">/**</span>
<span class="c"> * A static factory class for tree view expand/collapse animations</span>
<span class="c"> * @class TVAnim</span>
<span class="c"> * @static</span>
<span class="c"> */</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">TVAnim</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
    <span class="k">return</span> <span class="o">{</span>
        <span class="c">/**</span>
<span class="c">         * Constant for the fade in animation</span>
<span class="c">         * @property FADE_IN</span>
<span class="c">         * @type string</span>
<span class="c">         * @static</span>
<span class="c">         */</span>
        <span class="nx">FADE_IN</span><span class="o">:</span> <span class="s2">&quot;TVFadeIn&quot;</span><span class="o">,</span>

        <span class="c">/**</span>
<span class="c">         * Constant for the fade out animation</span>
<span class="c">         * @property FADE_OUT</span>
<span class="c">         * @type string</span>
<span class="c">         * @static</span>
<span class="c">         */</span>
        <span class="nx">FADE_OUT</span><span class="o">:</span> <span class="s2">&quot;TVFadeOut&quot;</span><span class="o">,</span>

        <span class="c">/**</span>
<span class="c">         * Returns a ygAnim instance of the given type</span>
<span class="c">         * @method getAnim</span>
<span class="c">         * @param type {string} the type of animation</span>
<span class="c">         * @param el {HTMLElement} the element to element (probably the children div)</span>
<span class="c">         * @param callback {function} function to invoke when the animation is done.</span>
<span class="c">         * @return {YAHOO.util.Animation} the animation instance</span>
<span class="c">         * @static</span>
<span class="c">         */</span>
        <span class="nx">getAnim</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">el</span><span class="o">,</span> <span class="nx">callback</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">[</span><span class="nx">type</span><span class="o">])</span> <span class="o">{</span>
                <span class="k">return</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">[</span><span class="nx">type</span><span class="o">](</span><span class="nx">el</span><span class="o">,</span> <span class="nx">callback</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">         * Returns true if the specified animation class is available</span>
<span class="c">         * @method isValid</span>
<span class="c">         * @param type {string} the type of animation</span>
<span class="c">         * @return {boolean} true if valid, false if not</span>
<span class="c">         * @static</span>
<span class="c">         */</span>
        <span class="nx">isValid</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">return</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">[</span><span class="nx">type</span><span class="o">]);</span>
        <span class="o">}</span>
    <span class="o">};</span>
<span class="o">}</span> <span class="o">();</span>
</pre></div>
                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div class="module">
                        <h4>Modules</h4>
                        <ul class="content">

                                <li class=""><a href="module_animation.html">animation</a></li>

                                <li class=""><a href="module_autocomplete.html">autocomplete</a></li>

                                <li class=""><a href="module_button.html">button</a></li>

                                <li class=""><a href="module_calendar.html">calendar</a></li>

                                <li class=""><a href="module_connection.html">connection</a></li>

                                <li class=""><a href="module_container.html">container</a></li>

                                <li class=""><a href="module_datasource.html">datasource</a></li>

                                <li class=""><a href="module_datatable.html">datatable</a></li>

                                <li class=""><a href="module_dom.html">dom</a></li>

                                <li class=""><a href="module_dragdrop.html">dragdrop</a></li>

                                <li class=""><a href="module_element.html">element</a></li>

                                <li class=""><a href="module_event.html">event</a></li>

                                <li class=""><a href="module_history.html">history</a></li>

                                <li class=""><a href="module_logger.html">logger</a></li>

                                <li class=""><a href="module_menu.html">menu</a></li>

                                <li class=""><a href="module_slider.html">slider</a></li>

                                <li class=""><a href="module_tabview.html">tabview</a></li>

                                <li class="selected"><a href="module_treeview.html">treeview</a></li>

                                <li class=""><a href="module_yahoo.html">yahoo</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.widget.HTMLNode.html">YAHOO.widget.HTMLNode</a></li>
                                <li class=""><a href="YAHOO.widget.MenuNode.html">YAHOO.widget.MenuNode</a></li>
                                <li class=""><a href="YAHOO.widget.Node.html">YAHOO.widget.Node</a></li>
                                <li class=""><a href="YAHOO.widget.RootNode.html">YAHOO.widget.RootNode</a></li>
                                <li class=""><a href="YAHOO.widget.TextNode.html">YAHOO.widget.TextNode</a></li>
                                <li class=""><a href="YAHOO.widget.TreeView.html">YAHOO.widget.TreeView</a></li>
                                <li class=""><a href="YAHOO.widget.TVAnim.html">YAHOO.widget.TVAnim</a></li>
                                <li class=""><a href="YAHOO.widget.TVFadeIn.html">YAHOO.widget.TVFadeIn</a></li>
                                <li class=""><a href="YAHOO.widget.TVFadeOut.html">YAHOO.widget.TVFadeOut</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="HTMLNode.js.html">HTMLNode.js</a></li>
                                <li class=""><a href="MenuNode.js.html">MenuNode.js</a></li>
                                <li class=""><a href="Node.js.html">Node.js</a></li>
                                <li class=""><a href="RootNode.js.html">RootNode.js</a></li>
                                <li class=""><a href="TextNode.js.html">TextNode.js</a></li>
                                <li class=""><a href="TreeView.js.html">TreeView.js</a></li>
                                <li class="selected"><a href="TVAnim.js.html">TVAnim.js</a></li>
                                <li class=""><a href="TVFadeIn.js.html">TVFadeIn.js</a></li>
                                <li class=""><a href="TVFadeOut.js.html">TVFadeOut.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2007 Yahoo! Inc. All rights reserved.
	</div>
</div>
</body>
</html>
